package pe.gob.foncodes.ssa.bs.common.service;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.jsp.jstl.sql.Result;
import pe.gob.foncodes.ssa.bs.common.dao.GenericDao;
import pe.gob.foncodes.ssa.bs.common.util.ServiceException;

public interface GenericService {

    public abstract Connection getConnection() throws Exception;

    public abstract Result getJstlResultFromQuery(String query) throws ServiceException;

    public abstract GenericDao getDAO();

    public abstract Object save(Object obj) throws Exception;

    public abstract void persist(Object obj) throws Exception;

    public abstract void delete(Object obj) throws Exception;

    public abstract Object findById(Class class1, Serializable serializable) throws Exception;

    public abstract List findByObject(Object obj) throws Exception;

    public abstract Object findByCode(Class class1, String c) throws Exception;

    public abstract Object findGeneralByCode(Class clazz, String cod) throws Exception;

    public abstract void deleteById(Class class1, Serializable serializable) throws Exception;

    public abstract void delete(Collection collection) throws Exception;

    public void refresh(Object object) throws ServiceException;

    public void refreshCollection(Collection collection) throws ServiceException;

    public abstract List findByNamedQuery(String queryName) throws ServiceException;

    public abstract List findByNamedQuery(String queryName, Object[] values) throws ServiceException;

    public abstract List findByNamedQuery(String queryName, Map<String, ?> params) throws ServiceException;

    public Object findByNamedQueryUniqueRow(String queryName, Object[] values) throws ServiceException;

    public abstract Integer executeUpdate(String queryName, Object[] values) throws ServiceException;

    public abstract boolean exists(Class class1, String s) throws Exception;

    public abstract String getIdFieldName(Class class1) throws Exception;

    public abstract void saveCollection(Collection collection) throws Exception;

    public abstract Date getCurrentDate() throws Exception;

    public List createNativeQuery(String queryName, Class clase) throws ServiceException;

    public Object createNativeQuery(String queryName) throws ServiceException;

    public List createNativeQuery(String queryName, Object[] values) throws ServiceException;

    public abstract Object getReference(Class class1, Serializable serializable) throws ServiceException;

    public abstract void initialize(Object object) throws Exception;

    public List find(String queryName) throws ServiceException;

    public abstract List findByObjectDif(String clase, String campo, String valor, Long idObj) throws Exception;

    public boolean actualizaEnCascada(Long id, String flgActivo, String nombreProcedure) throws ServiceException, Exception;

    public boolean agregaEnCascada(Long idOpcion, Long idAccion, Long idCtrlWeb, String flgActivo, String nombreProcedure) throws ServiceException, Exception;
            
    public List<Long> getModulosHijos(Long nidModulo) throws ServiceException;
    
    public boolean validaExistenciaEnPerfilOAutorizacion(Long nid, Long nidOpcion, String sTipo) throws ServiceException;
    
    public List<Object[]> reporteOpcionxModulo(Long nidModulo, Long nidPerfil, String codUsuario) throws ServiceException, Exception;
    
    public boolean actualizaPerfilOpcionEnCascada(Long idPerfil, Long idOpcion, String flgConsulta, String flgActivo, Long idCtrlWeb, String nombreProcedure) throws ServiceException, Exception;
    
}